<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript" src="../js/angular/angular.min.js"></script>
	</head>

	<body>
		<div ng-app="myapp" ng-controller="mycontr">
			<div>
				<input type="text" name="name" ng-model="name" />
				<input type="button" value="清空" ng-click="clearmy()" />
			</div>
			<div>
				hello,{{name}}
			</div>
		</div>
		<script type="text/javascript">
			var myapp = angular.module("myapp", []);
			myapp.controller("mycontr", ["$scope", function($scope) {
				$scope.name = "黑马程序员";
				$scope.clearmy = function() {
					$scope.name = "";
				};
			}]);
		</script>
	</body>

</html>